@extends('layouts.admin')
    @section('zjshopym')
    <li><a href="{{URL('admin/shopym')}}"> 编辑商品</a></li>
    <li><a href="{{URL('admin/shopym/add')}}"  class="active"> 增加商品</a></li>
    @endsection
    @section('xgleibie')
    <li><a href="{{url('admin/leibie')}}" >编辑类别</a></li>
    <li><a href="{{url('admin/leibie/add')}}"> 增加类别</a></li>
    @endsection
    @section('xgvip')
    <li><a href="{{url('admin/user')}}"><i class="fa fa-user"></i><span>会员管理</span></a></li>
    @endsection
    @section('xgdingdan')
    <li><a href="{{url('admin/dingdan')}}"><i class="fa fa-cube"></i><span>编辑订单</span></a></li>
    @endsection
    @section('xggonggao')
    <li><a href="{{URL('admin/gonggao')}}"> 编辑公告</a></li>
    <li><a href="{{URL('admin/gonggao/add')}}"> 增加公告</a></li>
    @endsection
      @section('page-wrapper')
        <div class="content">
            <div class="row">
                <div class="col-sm-12">
                    <h4 class="page-title">添加商品</h4>
                </div>
            </div>
            <div class="row">
                <div class="col-lg-12">
                    <div class="card-box">
                  
                        <h4 class="card-title" style="color: #009efb;cursor:pointer;" ><i class="fa fa-hand-o-left" aria-hidden="true"  style="margin-right: 3px;"></i><a onclick="javascript:history.back(-1);" >返回</a></h4>
                        <form action="addshopym" method="post" enctype="multipart/form-data" onsubmit="return sjyz(this)" >
                            <div class="form-group row">
                            <label class="col-form-label col-md-1.5"  style="margin-left: 11px;">图书名称</label>
                                <div class="col-md-3">
                                    <input type="text" class="form-control"  name="bookname">
                                </div>
                            </div>
                            <div class="form-group row">
                            <label class="col-form-label col-md-1.5"  style="margin-left: 11px;">书号</label>
                                <div class="col-md-3">
                                    <input type="text" class="form-control" name="isbn" style="margin-left: 28px;">
                                </div>
                            </div>
                            <div class="form-group row">
                            <label class="col-form-label col-md-1.5"  style="margin-left: 11px;">图书类型</label>
                                <div class="col-md-3">
                                
                                   <select name="typeid" id="" class="form-control" >
                                    <option value="1">科技类</option>
                                    <option value="2">教育类</option>
                                    <option value="3">文艺类</option>
                                    <option value="4">青春类</option>
                                    <option value="5">励志类</option>
                                    <option value="6">生活类</option>
                                    <option value="7">管理类</option>
                                  </select> 
                                </div>
                            </div>
                            <div class="form-group row">
                            <label class="col-form-label col-md-1.5"  style="margin-left: 11px;">作者</label>
                                <div class="col-md-3">
                                    <input type="text" class="form-control"  name="author" style="margin-left: 28px;">
                                </div>
                            </div>
                            <div class="form-group row">
                              <label class="col-form-label col-md-1.5"  style="margin-left: 11px;">出版社</label>
                                  <div class="col-md-3">
                                      <input type="text" class="form-control"  name="pubhouse"  style="margin-left: 14px;">
                                  </div>
                              </div>
                            <div class="form-group row">
                            <label class="col-form-label col-md-1.5"  style="margin-left: 11px;">出版时间</label>
                                <div class="col-md-3 input-group date" id='datetimepicker1'>
                                    <input type="date" class="form-control"   name="pubdate">
                                </div>
                            </div>
                            <div class="form-group row">
                              <label class="col-form-label col-md-1.5"  style="margin-left: 11px;">图书价格</label>
                                  <div class="col-md-3">
                                      <input type="text" class="form-control"  name="bookprice">
                                    
                                  </div>  <span  style="color:#F00" class="col-form-label">元</span>
                              </div>
                              <div class="form-group row">
                                <label class="col-form-label col-md-1.5"  style="margin-left: 11px;">折扣</label>
                                    <div class="col-md-3">
                                        <input type="text" class="form-control"  name="vipprice"  style="margin-left: 28px;">
                                      
                                    </div>  <span style="color:#F00" class="col-form-label">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;例:如是7.5就是打7.5折</span>
                                </div>
                                <div class="form-group row">
                                  <label class="col-form-label col-md-1.5"  style="margin-left: 11px;">图书图片</label>
                                      <div class="col-md-3 input-group date" id='datetimepicker1'>
                                          <input type="file" class="form-control"  name="photo">
                                      </div>
                                  </div>
                              <div class="form-group row">
                                <label class="col-form-label col-md-1.5" style="margin-left: 11px;">图书简介</label>
                                <div class="col-md-5 ">
                                  <textarea name="introduction" id=""  class="form-control"  cols="30" rows="5"></textarea>
                                </div>
                              </div>

                              <div class="form-group row">
                                <label class="col-form-label col-md-1.5"  style="margin-left: 11px;">是否推荐</label>
                                    <div class="col-md-3">
                                      <label class="radio-inline col-form-label">
                                        <input type="radio" name="recommend" id="" value="1" > 是
                                    </label>
                                    &nbsp;&nbsp;&nbsp;
                                    <label class="radio-inline col-form-label">
                                        <input type="radio" name="recommend" id=""  value="0"> 否
                                    </label>

                                    </div>
                             </div>
                             <div class="form-group row">
                              <label class="col-form-label col-md-1.5"  style="margin-left: 11px;">图书预售</label>
                                  <div class="col-md-3">
                                    <label class="radio-inline col-form-label">
                                      <input type="radio"  name="newbook" id="" value="1" > 是
                                  </label>
                                  &nbsp;&nbsp;&nbsp;
                                  <label class="radio-inline col-form-label">
                                      <input type="radio"  name="newbook" id=""  value="0"> 否
                                  </label>

                                  </div>
                           </div>
                            {{csrf_field()}}
                           
                            <div class="form-group row" style="margin-left: 53.5px;margin-top: 30px;">
                              <div class="col-md-1">
                                  <input type="submit" value="提交"  class="btn btn-primary" style="color: #fff;border-style: none;">
                              </div>
                              <div class="col-md-1">
                                <input type="reset" value="重置"  class="btn btn-primary" style="color: #fff;background-color:#888;border-style: none;">
                            </div>
                          </div>
                        </form>
                    </div>
                </div>
            </div>
</div>

<script language="javascript">
function sjyz(fom){
	if(fom.bookname.value==''){
		alert("请输入图书名称");
		fom.bookname.select();
		return false;
		}
	if(fom.isbn.value==''){
		alert("请输入书号");
		fom.isbn.select();
		return false;
		}
	if(fom.author.value==''){
		alert("请输入作者");
		fom.author.select();
		return false;
		}
	if(fom.pubhouse.value==''){
		alert("请输入出版社");
		fom.pubhouse.select();
		return false;
		}
	if(fom.bookprice.value==''){
		alert("请输入图书价格");
		fom.bookprice.select();
		return false;
		}
	if(fom.vipprice.value==''){
		alert("请输入折扣");
		fom.vipprice.select();
		return false;
		}
	if(fom.photo.value==''){
		alert("请输入图片");
		fom.photo.select();
		return false;
		}
    if(fom.introduction.value==''){
    alert("请输入简介");
    fom.introduction.select();
    return false;
    }

	}
	
$(function () {

$('#datetimepicker1').datetimepicker({

    format: 'YYYY-MM-DD',

    locale: moment.locale('zh-cn')

});

});

</script>
@endsection